package com.itheima.app.controller;

import com.itheima.app.manager.TaoHuaManager;
import com.itheima.vo.TaohuaVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/peachblossom")
public class TaoHuaController {

    @Autowired
    TaoHuaManager taoHuaManager;

    //发送桃花语音
    @PostMapping
    public void save(MultipartFile soundFile) throws IOException {
        taoHuaManager.save(soundFile);
    }


    //接受语音
    @GetMapping
    public TaohuaVo AcceptTaoHua(){

        return taoHuaManager.AcceptTaoHua();
    }
}
